var RewordItem = require("RewordItem")
var Actor = require("Actor")

cc.Class({
    extends: cc.Component,

    properties: {
        actor: Actor,
        point: cc.Label,
        items: {
            default: [],
            type: RewordItem,
            readonly: true,
            displayName: "打赏条目"
        }
    },

    // use this for initialization
    onLoad: function () {
        window.sock.node.on("11-4", e => {
            let user = e.detail

            this.actor.user = user.info
            this.point.string = "2000"
        })

        let infos = [{ count: 10 }, { count: 20 }, { count: 30 }]
        for (let i = 0; i < 3; i++) {
            this.items[i].config(infos[i])
        }
    },

    startCountDown() {

    },

    contiune() {
        window.ui.activity.show()
        this.node.active = false
    },

    quit() {
        window.sock.standUp({ index: 0 })
        window.sock.gateway({ uid: 5, l1: 0, n1: 0 })
    },

});
